import { MessageBox } from 'element-ui'
export const msgConfirm = function (msg, fun) {
    MessageBox.confirm(msg, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        dangerouslyUseHTMLString: true,
        beforeClose: (action, instance, done) => {
            if (action === 'confirm') {
                instance.confirmButtonLoading = true
                fun().finally(() => {
                    instance.confirmButtonLoading = false
                    done()
                })
            } else {
                done()
            }
        },
        callback: () => {}
    })
}
